import {Component, Input, OnInit} from '@angular/core';
import {WorkStatusService} from '../../../services/news/WorkStatus/work-status.service';
import {Observable} from 'rxjs/Observable';
import {Wdetail} from '../../../services/news/momain/wdetail';

@Component({
  selector: 'app-work-dynamics-edit',
  templateUrl: './work-dynamics-edit.component.html',
  styleUrls: ['./work-dynamics-edit.component.less']
})
export class WorkDynamicsEditComponent implements OnInit {

  @Input()
  order: string;

  detail: Wdetail;

  constructor(private wo: WorkStatusService) {
  }

  ngOnInit() {
    let value: string = this.order.split('-')[0];
    this.wo.getDetail(value).toPromise().then(value1 => {this.detail = value1;console.log("xxxxxxxxxxx");});
  }

  getDetail() {
    let value: string = this.order.split('-')[0];
    console.log(value);
    /*this.wo.getDetail();*/
  }

}
